import React from 'react';
import { HashRouter as Router, useRoutes, Link } from 'react-router-dom';
// 导入路由规则
import routes from './router/routes';
import Navbar from './components/Navbar';
// 导入样式文件
import './App.scss';
// 生成路由规则
const RouterView = () => {
  // 使用useRoutes之后, 就不需要再使用Routes组件了
  const elements = useRoutes(routes);
  return elements;
}

function App() {

  return (
    <Router>
      {/* 路由规则 */}
      <RouterView />
      {/* 导航菜单 */}
      <Navbar />
    </Router>
  )
}

export default App
